40823152cd2021

  • Home
    • Site Map
    • reveal
    • blog
  • about
  • W1-W4
    • W1
      • leo教學
      • 分組(2人專案)
    • W2
      • 轉軸問題
      • 擊球問題
      • coppeliaSim 比例問題
    • W3
      • 製作簡報
      • 小組網站(共同維護)
    • W4
      • 報告
      • cd2021_2a_age影片排序
      • Ant Renamer 操作說明
  • W5-w9
    • W5
      • stage2-ag12
      • 產品目標
      • 工作分配
    • W6
      • Lua control speed
    • W7
      • keyboard control
      • keyboard control for Four-bar linkage
    • W8
      • Inquire keyboard number
      • basketball Machine 2.4.3
  • stage1-product
    • 版本一
    • 版本二
    • 版本三
    • 版本四
    • pdf
  • Stage2-product
    • 2.1
    • 2.2
    • 2.3
    • 2.4
  • Stage3
    • W10
      • task1
      • task2
    • W11
      • task 1 教學
    • W12
      • stage2-ag12 python keyboard
    • W13
      • gitlab操作
      • xml
    • W14
      • fanuc_m710ic_50_pick_and_place
      • fanuc_m710ic_50_pick_and_place add suction ped
    • W15
      • MTB_robot_pick_and_place
      • MTB_robot_pick_and_place delete GUI
      • Movie subtite
    • W16
      • MTB_robot onshape
      • MTB_robot coppeliasim
      • MTB_robot add suction pad
      • MTB_robot add IK
      • MTB_robot python remote api
      • MTB_robo use require
    • W17
      • basketball machine add Mtb_robot
      • basketball machine final
    • W18
  • github flagged
  • Bug
    • Wsgi.py 打不開
MTB_robot add suction pad << Previous Next >> MTB_robot python remote api

MTB_robot add IK

使用老師的逆運動學函式求出終點位置的位移,使MTB_robot在coppeliasim裡可以順利達到老師要求的位置

W16_exam.7z error版本

W16_exam.7z

loop迴圈影片:

因為迴圈做不出來,發現到46號網站的內容,找出wait問題點後的操作狀態

參考40823246

正確位置的影片(鍵盤)

錯誤位置的影片,但是有求出a1與a2。

老師的程式

修改後的程式

-- The decimal point of number x is rounded to the nth place
function round(x, n)
    n = math.pow(10, n or 0)
    x = x * n
    if x >= 0 then x = math.floor(x + 0.5) else x = math.ceil(x - 0.5) end
    return x / n
end
 
-- radian to degree
deg = 180/math.pi
-- link 1 length
a1 =0.467
-- link 2 length
a2 =0.4
-- derivated based upon https://www.youtube.com/watch?v=IKOGwoJ2HLk&t=311s
function ik(x, y)
    -- (x, y) need to be located inside the circle with radius a1+a2
    if (x^2 + y^2) <= (a1+ a2)^2 then
        q2 = math.acos((x^2+y^2-a1^2-a2^2)/(2*a1*a2))
        q1 = math.atan2(y, x) - math.atan2((a2*math.sin(q2)), (a1+a2*math.cos(q2)))
        return {round(q1*deg, 4), round(q2*deg, 4)}
    else
        print("Over range!")
        -- end the script execution
        os.exit()
    end
end
 
theta = ik(-0.3, -0.55)
 
print(theta[1], theta[2])
  

lua 編譯網站:


MTB_robot add suction pad << Previous Next >> MTB_robot python remote api

Copyright © All rights reserved | This template is made with by Colorlib